import logger from '../tools/logger'

interface typePlugin<T>{
    name:string,
    plugin:T
}

interface typeRegisterPlugin<T> {

    [key:string]:typePlugin<T>
}

const Plugins:typeRegisterPlugin<any>  = {}

function registerPlugin<T>(plugin: typePlugin<T>): void {
    logger.info(`registerPlugin : ${plugin.name}`);
    Plugins[plugin.name] = plugin;
}
export {typeRegisterPlugin,typePlugin}

export {registerPlugin}

export default (()=>{
    import('./registerPlugins')
    return Plugins
})()